home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8929 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.3 KB

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
  4. Subject: Re: Access carry flag from C
  5. Date: Tue, 27 Feb 1996 14:17:04 GMT
  6. Organization: Netcom
  7. Message-ID: <313311cf.52007562@nntp.ix.netcom.com>
  8. References: <Dn1C9z.DGv.0.net@indra.com> <1996Feb1922.17.19.879@koobera.math.uic.edu> <31298D20.41C6@bazis.nl> <danpop.824859220@rscernix> <312AFACE.41C6@bazis.nl> <TANMOY.96Feb21081640@qcd.lanl.gov> <312D8414.167E@bazis.nl> <TANMOY.96Feb23101510@qcd.lanl.gov>
  9. NNTP-Posting-Host: ix-dc13-13.ix.netcom.com
  10. X-NETCOM-Date: Tue Feb 27  6:16:56 AM PST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) wrote:
  14.  
  15. > <snip>
  16. > FK: Tanmoy Bhattacharya wrote:
  17. > FK: > 
  18. > FK: > In article <312AFACE.41C6@bazis.nl> Franz Korntner <fkorntne@bazis.nl>
  19. > FK: > writes:
  20. > FK: > <snip>
  21. > FK: >    32 bit numbers. According to the (X3J11 / ANSI) standard, the constant
  22. > FK: >    INT_MAX (and in this case most limits in limits.h) denotes the minimal
  23. > FK: >    limit. It is possible that the physical limit is much higher (or lower
  24. > FK: >    in the case of negative values). As I am only interested in the physical
  25. > FK: >    limit, the value INT_MAX has no meaning. Only the compiler is fully aware
  26. > FK: >    of these limits (and not a header file!) and what I really miss in the
  27. > FK: >    standard and/or implementation is a inline function 'maxlimitof(int)',
  28. > FK: >    analogical to 'sizeof(int)'.
  29. > FK: > 
  30. > FK: > Please quote the standard. I find no discussion of this in my copy;
  31. > FK: > and I suspect it is incorrect.
  32. > FK: 
  33. > FK: I only have a copy of the Rationale at this moment, and it is also
  34. > mentioned 
  35. > FK: on page 17, Environmental limits.
  36. > FK: 
  37. > FK: 2.2.4.2.1 Sizes of integral types <limits.h>. Such a large body of C code
  38. > FK: has been developed for the 8-bit byte machines that the integer sizes in
  39. > FK: such environments must be considered normative. The prescribed limits are
  40. > FK: minima; an implementation on a machine with 9-bit bytes can be conforming,
  41. > FK: as can an implementation that defines int to be the same width as long.
  42. > FK: page 17.
  43. > I don't understand what you are saying! Have you read the clause?
  44. >     5.2.4.2 (your 2.2.4.2):
  45. >     A conforming implementation shall document all the limits specified in
  46. >     this subclause.
  47. >     5.2.4.2.1:
  48. >     The values given below shall be replaced by constant expressions
  49. >     ... Their implementation-defined values shall be greater in magnitude
  50. >     (absolute value) to those shown, with the same sign.
  51. >     ...
  52. >     --- maximum value for an object of type int
  53. >     INT_MAX   +32767
  54. > Is there any doubt as to what this means? The only interpretation I
  55. > can think of is that INT_MAX is the maximum value of type int, this
  56. > has to be defined by the implementation, the definition is to be a
  57. > constant, and this constant has to exceed 32767. 
  58. > It states explicitly that INT_MAX is the maximum value of type int
  59. > ... how do you read anything else?
  60.  
  61. That's not how 5.2.4.2.1 reads in my copy of the standard.  I have:
  62.  
  63.     The values given below shall be replaced by constant
  64.     expressions ... Their implementation-defined values shall be
  65.     equal or greater in magnitude (absolute value) to those shown,
  66.     with the same sign.
  67.  
  68. This allows INT_MAX to be equal to 32767.
  69.  
  70. Michael M Rubenstein
  71.